<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function func(num){
            return num==1?1:num*func(num-1);
        }

        let proxy=new Proxy(func,{
            apply(thisfunc,obj,args){ //thisfunc为当前函数，obj为上下文,args为变量
               console.time("run");
                   thisfunc(args);  //
               console.timeEnd("run")
            }
        });
        proxy(20);
    </script>
</body>
</html>